<template>
	<view>
		
		<u-tabbar active-color="#fa3534"   v-model="current" :list="barlist" :mid-button="true"></u-tabbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				barlist: [{
										iconPath: "home",
										selectedIconPath: "home-fill",
										text: '首页',
									
										isDot: false,
										customIcon: false,
										pagePath:'/pages/index/index'
									},
									{
										iconPath: "file-text",
										selectedIconPath: "file-text-fill",
										text: '通讯录',
										customIcon: false,
										pagePath:'/pages/books/list'
									},
									{
										iconPath: "https://cdn.uviewui.com/uview/common/min_button.png",
										selectedIconPath: "https://img.alicdn.com/imgextra/i1/49409654/O1CN01bx1llz2LBaK66oFEN_!!49409654.png",
										text: '发布',
										midButton: true,
										customIcon: false,
										pagePath:'/pages/tie/add'
									},
									{
										iconPath: "chat",
										selectedIconPath: "chat-fill",
										text: '消息',
										count: 0,
										customIcon: false,
										pagePath:'/pages/user/msg'
									},
									{
										iconPath: "account",
										selectedIconPath: "account-fill",
										text: '我的',
							
										isDot: false,
										customIcon: false,
										pagePath:'/pages/user/index'
										
									},
								],
								current: 0,
			}
		},
		mounted:function(){
		   //获取未读消息
		     let user=uni.getStorageSync("user")
			 if (user.id<1){
				 this.barlist[3].count=0
			 }else{
				
				 this.$u.post('index.php?class=comment&act=noread', {
				 	uid: user.id
				 }).then(res => {
				 	this.barlist[3].count=res.data
				 });
			 }
			 
		},
		methods: {
			
		}
	}
</script>

<style>

</style>
